#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <map>
using namespace std;

int main()
{
    string s;
    int Max = 0;
    char Maxc;
    map<char, int> m;
    while (getline(cin, s))
    {
        for (auto a : s)
        {
            if (a != ' ') m[a]++;
            if (m[a] > Max)
            {
                Max = m[a];
                Maxc = a;
            }
        }
    }
    cout << Maxc << endl;
}
